<?
$cntItems = count($items);
?>

<? foreach ($items as $i => $item):?>
	<? if($i != 0): ?>
	>
	<? endif; ?>
	
	<?
	if(isset($item['url'])){
		$url = $item['url'];
	}elseif(isset($item['category_id'])){
		$ctx = QContext::instance();
		if($ctx->namespace == 'admin'){
			$url = url('category', array('category_id'=> $item['category_id']));
		}else{// website
			$url = url('product/list', array('category_id'=> $item['category_id']));
		}
		
	}else{
		$url = '#';
	}
	?>
	
	<? if($i+ 1 == $cntItems): /*the last one*/ ?>
	<?= ucwords($item['name']) ?>
	<? else:?>
	<a href="<?=$url?>"><?= ucwords($item['name']) ?></a>
	<? endif; ?>
<? endforeach;?>